package com.woniuxy.config;


import com.woniuxy.interceptor.AuthrizaIntecepter;
//import com.woniuxy.interceptor.BloomInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author dingpf
 * @version 1.0
 * @description
 * @create 2024/8/26 11:26
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    @Autowired
    private AuthrizaIntecepter authrizaIntecepter;
//    @Autowired
//    private BloomInterceptor bloomInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authrizaIntecepter)
                .addPathPatterns("/**") //全部都拦截
                .excludePathPatterns("/powerUser/login")
                .order(1); //设置拦截器执行顺序

    }
}
